import { UserModel } from "@/database";
import type { User } from "~/type";


/**
 * 获取登录用户信息
 * @url /api/v1/getLoginInfo
 * @method GET
 */
export default defineEventHandler(async (event) => {
    const userId = event.context.user_id as number
    const { password, ...newUser } = UserModel[userId ?? 0]

    return successApi('登录成功', newUser)
})